import request from '@/utils/request'

export default {
    /**
     * //根据课程id获取章节和小节数据列表
     * @param {*} courseId 
     * @returns 
     */
    getAllChapterVideo(courseId) {
        return request({
            url: `/edu/chapter/getChapterVideo/${courseId}`,
            method: 'get'
        })
    },
    /**
     * //添加章节
     * @param {*} chapter 
     * @returns 
     */
    addChapter(chapter) {
        return request({
            url: '/edu/chapter/addChapter',
            method: 'post',
            data: chapter
        })
    },
    /**
     * //根据id查询章节
     * @param {*} chapterId 
     * @returns 
     */
    getChapter(chapterId) {
        return request({
            url: `/edu/chapter/getChapterInfo/${chapterId}`,
            method: 'get'
        })
    },
    /**
     * //修改章节
     * @param {*} chapter 
     * @returns 
     */
    updateChapter(chapter) {
        return request({
            url: '/edu/chapter/updateChapter',
            method: 'post',
            data: chapter
        })
    },

    /**
     * //删除章节
     * @param {*} chapterId 
     * @returns 
     */
    deleteChapter(chapterId) {
        return request({
            url: `/edu/chapter/deleteChapter/${chapterId}`,
            method: 'delete'
        })
    }
}